package ldh.im.rpc.exception;

public enum RpcErrorCode implements ErrorCode {
    ConnectionError(0, "连接服务器失败"),

    SocketIoException(1, "Socket IO 异常"),

    CodecException(2, "编码失败"),

    Api_error(3, "接口定义错误, method: %s"),
    No_path(10, "%s没有对应的路由器， router=%s"),
    No_router(11, "%s没有对应的路由器%s"),
    Business_error(12, "%s"),
    Param_failure(13, "参数错误：%s"),
    Result_error(14, "返回值异常, %s"),
    Filter_failure(15, "%s过滤器拦截"),
    ;

    private int code;
    private String message;

    private RpcErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getErrorCode() {
        return code;
    }

    @Override
    public String getErrorMessage() {
        return message;
    }

}
